package com.code.platform.modules.bookauthor.service.impl;

import com.code.platform.common.exception.BusinessException;
import com.code.platform.common.utils.StringUtils;
import com.code.platform.modules.bookauthor.mapper.BookAuthorMapper;
import com.code.platform.modules.bookauthor.model.BookAuthor;
import com.code.platform.modules.bookauthor.service.IBookAuthor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 作者service
 * Created by liuyj on 2017/1/2.
 */
@Service
public class IBookAuthorImpl implements IBookAuthor {


    @Autowired
    private BookAuthorMapper bookAuthorMapper;


    /**
     * 根据主键获取作者信息 liuyj
     *
     * @param id 主键id
     * @return
     * @throws BusinessException
     */
    @Override
    public BookAuthor getAuthorById(String id) throws BusinessException {
        return bookAuthorMapper.selectByPrimaryKey(StringUtils.toLong(id));
    }
}
